﻿using d1Common;
using d1Common.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;

namespace d1Project
{
    public class Program
    {
        static void Main(string[] args)
        {
            Console.Write("Services is starting ...");

            try
            {
                //初始化所有服务
                doServices.Instance.InitServices();
            }
            catch (Exception _err)
            {
                Console.WriteLine(" error:");
                Console.WriteLine(_err.Message);
                Console.WriteLine(_err.StackTrace);
                Console.WriteLine("");
                Console.WriteLine("press any key to exit ...");
                Console.ReadLine();
                return;
            }
            Console.WriteLine(" successfully!");
            string _command = null;
            while (_command != "exit")
            {
                if (_command != null && _command.Length > 0)
                {
                    Console.WriteLine("bad command: " + _command);
                }
                Console.Write(">");
                _command = Console.ReadLine();
            }
            System.Diagnostics.Process.GetCurrentProcess().Kill();
            System.Environment.Exit(0);
        }
    }
}